import 'package:flutter/material.dart';

class ComposeView1500Page extends StatefulWidget {
  const ComposeView1500Page({super.key});

  @override
  State<ComposeView1500Page> createState() => _ComposeView1500PageState();
}

class _ComposeView1500PageState extends State<ComposeView1500Page> {
  final DateTime _start = DateTime.now();
  final int totalCount = 1500;

  @override
  void initState() {
    super.initState();

    WidgetsBinding.instance.addPostFrameCallback((_) {
      final duration =
          DateTime.now().difference(_start).inMilliseconds;
      debugPrint("🕒 页面构建 + 渲染耗时：$duration ms");
    });
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: const Text('Flutter ComposeView1500Page')),
      body: SingleChildScrollView(
        child: Column(
          children: List.generate(totalCount, (index) {
            return Container(
              width: 300,
              height: 100,
              decoration: BoxDecoration(
                border: Border.all(color: Colors.red, width: 2),
              ),
              alignment: Alignment.center,
              child: Text('Item #$index'),
            );
          }),
        ),
      ),
    );
  }
}